package com.fate.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fate.domain.Area;
import com.fate.service.AreaService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("admin/area")
@Api(tags = "区域管理接口")
public class AreaController {

    @Autowired
    private AreaService areaService;

    /**
     * 分页查询区域
     * @param page
     * @param area
     * @return
     */
    @GetMapping("page")
    @ApiOperation("全查询区域")
    @PreAuthorize("hasAuthority('admin:area:list')")
    public ResponseEntity<List<Area>> findAreaPage(Page<Area>page,Area area){
        List<Area>areas =  areaService.List();
       return ResponseEntity.ok(areas);
    }





















}
